<?php
/**
 * 文章验证器
 */

namespace app\common\validate;

class ArticleValidate extends Validate
{
    protected $rule = [
            'cid|文章分类' => 'require',
    'title|文章标题' => 'require',
    'synopsis|文字简介' => 'require',
    'image|文章图片' => 'require',
    'is_notice|是否公告:1-是.0-否' => 'require',
    'content|文章内容' => 'require',
    'visit|浏览人数' => 'require',
    'sort|排序' => 'require',
    'is_show|是否显示:1-是.0-否' => 'require',
    'likes|点赞数' => 'require',

    ];

    protected $message = [
            'cid.require' => '文章分类不能为空',
    'title.require' => '文章标题不能为空',
    'synopsis.require' => '文字简介不能为空',
    'image.require' => '文章图片不能为空',
    'is_notice.require' => '是否公告:1-是.0-否不能为空',
    'content.require' => '文章内容不能为空',
    'visit.require' => '浏览人数不能为空',
    'sort.require' => '排序不能为空',
    'is_show.require' => '是否显示:1-是.0-否不能为空',
    'likes.require' => '点赞数不能为空',

    ];

    protected $scene = [
        'add'  => ['cid','title','synopsis','image','is_notice','content','visit','sort','is_show','likes',],
'edit' => ['cid','title','synopsis','image','is_notice','content','visit','sort','is_show','likes',],

    ];

    

}
